<h1>Listing issues</h1>

<table>
  <tr>
  <% for column in Issue.content_columns %>
    <th><%= column.human_name %></th>
  <% end %>
  </tr>
  
<% for issue in @issues %>
  <tr>
  <% for column in Issue.content_columns %>
    <% if column.name == "status" %>
    <td><%=h issue.status_name %></td>
    <%else%>
    <td><%=h issue.send(column.name)%></td>
    <%end%>
  <% end %>
    <td><%= link_to 'List sections', { :action => 'list_sections_by_issue', :id => issue}  %></td>
    <td><%= link_to 'Show', :action => 'show_issue', :id => issue %></td>
    <td><%= link_to 'Edit', :action => 'edit_issue', :id => issue %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy_issue', :id => issue }, :confirm => 'Are you sure?' %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @issue_pages.current.previous } if @issue_pages.current.previous %>
<%= link_to 'Next page', { :page => @issue_pages.current.next } if @issue_pages.current.next %> 

<br />

<%# link_to 'New issue', :action => 'new_issue' %>
